###########################################################
#
# Filename: Makefile
#
# Project: ic2Net
#
# Builds Shared Library For Handling I2C Network and Devices
###########################################################
include ../build_env/env.mk
include ../build_env/gumstix.mk

LIBRARY=i2cNet

LIBRARY_FILE= $(LOCAL)lib$(LIBRARY).so

TEST_PROGRAM=i2cTests

TEST_OBJECTS = \
	$(OBJDIR)/i2cTests.o

OBJECTS = \
	$(OBJDIR)/i2cNet.o \
	$(OBJDIR)/i2cDevice.o

TEST_LIBS= -l$(LIBRARY) -L$(LOCAL)


INCLUDES+= -I$(INCDIR)
default: all

all: library tests

tests: $(TEST_PROGRAM)

$(TEST_PROGRAM): $(TEST_OBJECTS) $(LIBRARY_FILE)
	$(LINK) $< $(TEST_LIBS) -o $@

library: $(LIBRARY_FILE)

$(LIBRARY_FILE): revision_info $(OBJECTS) 
	$(SOLINK) $(OBJECTS) -o $@

include ../build_env/revision_info.mk

clean: revision_clean library_clean tests_clean

library_clean:
	rm -f $(OBJECTS) $(LIBRARY_FILE)

tests_clean:
	rm -f $(TEST_OBJECTS) $(TEST_PROGRAM)



